MAX_DATA_LEN=250
KEY_LEN=16
MAX_TOTAL_PEER_NUM=20
MAX_ENCRYPT_PEER_NUM=6

class ESPNow(object):
	'''
	This module provides an interface to the ESP-Now protocol provided by Espressif on ESP32 and ESP8266 devices. Some calls are only available on the ESP32 due to code size restrictions on the ESP8266 and differences in the Espressif API.
	'''
	def init(self):
		'''
		Prepare the software and hardware for use of the ESPNow communication protocol
		'''
		...

	def deinit(self):
		'''
		De-initialise the Espressif ESPNow software stack (esp_now_deinit()), disable callbacks and deallocate the recv data buffer.
		'''
		...

	def config(self, param):
		'''
		Get or set configuration values of the ESPNow interface.
		'''
		...

	def set_pmk(self, pmk):
		'''
		Set the Primary Master Key (PMK) which is used to encrypt the Local Master Keys (LMK) for encrypting ESPNow data traffic.
		'''
		...
	
	def send(self, mac, msg, sync=True):
		'''
		Send the data contained in msg to the peer with given network mac address.
		'''
		...
	
	def send(self, msg):
		'''
		Send the data contained in msg to the peer with given network mac address.
		'''
		...
	
	def recv(self, timeout=5 * 60 * 1000):
		'''
		Wait for an incoming message and return.
		'''
		...
	
	def irecv(self, timeout=5 * 60 * 1000):
		'''
		Wait for an incoming message and return.
		'''
		...
	
	def poll(self):
		'''
		Return True if data is available to be read with recv()/irecv(). Return False otherwise.
		'''
		...
	
	def stat(self):
		'''
		Return a 5-tuple containing the number of packets sent/received/lost.
		'''
		...
	
	def add_peer(self, mac, lmk=b'', channel=0, ifidx=0, encrypt=False):
		'''
		Add/register the provided mac address (a 6-byte byte-string) as a peer under the ESPNow protocol.
		'''
		...

	def get_peer(self, mac):
		'''
		Return a 5-tuple of the “peer info” associated with the mac address.
		'''
		...
	
	def peer_count(self):
		'''
		Return the number of peers which have been registered.
		'''
		...
	
	def get_peers(self):
		'''
		Return the “peer info” parameters for all the registered peers (as a tuple of tuples).
		'''
		...
	
	def mod_peer(self, mac, lmk, channel=0, ifidx=0, encrypt=False):
		'''
		Modify the parameters of the peer associated with the provided mac address. 
		'''
		...
	
	def del_peer(self, mac):
		'''
		Deregister the peer associated with the provided mac address.
		'''
		...
	
	def read(self, size=-1):
		'''
		Return up to size bytes read from the espnow recv buffers as a byte string.
		'''
		...
	
	def read1(self, size=-1):
		'''
		As for read() but will return after at most one packet is read.
		'''
		...
	
	def readinto(self, b):
		'''
		Read bytes into a pre-allocated, writable bytes-like object (eg. bytearray) and return the number of bytes read.
		'''
		...
	
	def readinto1(self, b):
		'''
		As for readinto() but will return after at most one packet is read.
		'''
		...
	
	def write(self, b):
		'''
		Write the given bytes-like object to the ESPNow interface. 
		'''
		...
